package com.dup.jxlh.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dup.jxlh.admin.entities.handler.ChapterTypeHandler;
import com.dup.jxlh.admin.entities.model.ChapterType;
import org.apache.ibatis.annotations.*;

import java.math.BigInteger;
import java.util.ArrayList;

@Mapper
public interface ChapterTypeMapper extends BaseMapper<ChapterType> {
    @Select("select chapter_type.* from chapter_type where chapter_apply_id = #{chapterApplyId}")
    @Results({
            @Result(column = "type", property = "type"),
            @Result(column = "type", property = "typeName", typeHandler = ChapterTypeHandler.class)
    })
    ArrayList<ChapterType> getChapterTypeList(@Param("chapterApplyId")BigInteger chapterApplyId);

    @Select("select type from chapter_type where chapter_apply_id = #{chapterApplyId}")
    @Results({
            @Result(column = "type", property = "type"),
            @Result(column = "type", property = "typeName", typeHandler = ChapterTypeHandler.class)
    })
    Integer[] getChapterType(@Param("chapterApplyId")BigInteger chapterApplyId);
}
